fix(F148): background context_briefing renders as card instead of raw JSON#395
fix(F148): background context_briefing renders as card instead of raw JSON#395
Conversation
…ndler Background thread's system_info handler was missing the context_briefing branch, causing raw JSON to render as a plain system bubble instead of a BriefingCard. Mirrors the existing foreground logic in useAgentMessages. [砚砚/GPT-54🐾] [宪宪/Opus-46🐾] Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
a9d288b to
f91933a
Compare
|
@codex review Please review latest commit f91933a for P1/P2 only. 规则:任何 P1/P2 必须给"可执行复现":
审查标准(详见 AGENTS.md "Review guidelines" section):
|
|
Codex Review: Didn't find any major issues. You're on a roll. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review Please review latest commit 5ad135d for P1/P2 only. 规则:任何 P1/P2 必须给"可执行复现":
审查标准(详见 AGENTS.md "Review guidelines" section):
|
|
Codex Review: Didn't find any major issues. You're on a roll. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review Please review latest commit 35b1852 for P1/P2 only. 规则:任何 P1/P2 必须给"可执行复现":
审查标准(详见 AGENTS.md "Review guidelines" section):
|
There was a problem hiding this comment.
💡 Codex Review
clowder-ai/scripts/install-auth-config.mjs
Lines 348 to 349 in 35b1852
The new homedir fallback swallows every error via catch {}, even though the adjacent comment says only corrupt homedir files should be ignored; this hides deterministic filesystem failures and silently skips migration. Repro (deterministic): tmp=$(mktemp -d); mkdir -p "$tmp/proj/.cat-cafe" "$tmp/home/.cat-cafe/provider-profiles.json"; HOME="$tmp/home" node scripts/install-auth-config.mjs client-auth set --project-dir "$tmp/proj" --client openai --mode oauth; echo $? (input makes provider-profiles.json a directory, so reading it raises EISDIR). Expected: non-corrupt migration failure is surfaced (non-zero exit); actual: command exits 0 and continues, so legacy homedir data is skipped without any signal.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Review triage for the reported P2 on
So this finding points to existing main-branch behavior, not a regression introduced by the |
|
@codex review Please review latest commit ac0e72b for P1/P2 only. 规则:任何 P1/P2 必须给"可执行复现":
审查标准(详见 AGENTS.md "Review guidelines" section):
|
|
Codex Review: Didn't find any major issues. Another round soon, please! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review Please review latest commit a604b6f for P1/P2 only. 规则:任何 P1/P2 必须给"可执行复现":
审查标准(详见 AGENTS.md "Review guidelines" section):
|
There was a problem hiding this comment.
💡 Codex Review
clowder-ai/packages/api/src/routes/schedule.ts
Lines 237 to 238 in a604b6f
Deterministic repro: curl -s -X POST /api/schedule/tasks/preview with {"templateId":"reminder","trigger":{"type":"once","delayMs":60000}}, copy returned draft.trigger.fireAt, wait 70s, then curl -s -X POST /api/schedule/tasks reusing that fireAt; expected behavior is “run ~60s after registration/confirmation”, but actual behavior is immediate execution because preview already converted the relative delay to an absolute timestamp. This breaks the required preview→confirm workflow for one-shot tasks when confirmation is delayed.
Deterministic repro: create a once task via POST /api/schedule/tasks with a forged createdBy (e.g. "spoof-cat") and a near-future fire time, stop the service before it fires, then restart after the scheduled time; expected lifecycle notification to come from a trusted system sender, but actual notification uses catId from persisted task data, enabling identity spoofing in missed-window messages. This is especially risky because createdBy is client-provided at task creation.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Review triage for the reported P1 on
So this finding does not describe a regression introduced by the |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d55072398
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| }); | ||
| } | ||
| consumed = true; |
There was a problem hiding this comment.
Preserve fallback when briefing payload is incomplete
This branch marks context_briefing as consumed even when no message was actually inserted (for example, if storedMessage exists but id is missing/invalid). In that case the background thread drops the event entirely instead of falling back to the existing raw system bubble path, so users get no visible signal and debugging becomes harder. Only setting consumed = true after a successful addMessageToThread would keep the previous fail-open behavior.
Useful? React with 👍 / 👎.
|
@codex review Please review latest commit c2ea740 for P1/P2 only. 规则:任何 P1/P2 必须给"可执行复现":
审查标准(详见 AGENTS.md "Review guidelines" section):
|
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review Please review latest commit 8ebf23f for P1/P2 only. 规则:任何 P1/P2 必须给"可执行复现":
审查标准(详见 AGENTS.md "Review guidelines" section):
|
There was a problem hiding this comment.
💡 Codex Review
可执行复现(最小 failing test): 在 packages/api/test/gemini-agent-service.test.js 新增用例,创建同一 sessionId 的两个 session-*.json(较新文件 messages 无 thoughts,较旧文件含匹配 content 与 thoughts),然后运行 node --test packages/api/test/gemini-agent-service.test.js --test-name-pattern "gemini session fallback"。期望:服务继续扫描并从较旧文件发出 system_info(type=thinking);实际:在首个匹配文件走到 candidates.length === 0 时直接返回,提前退出,导致 thinking 丢失。
可执行复现(最小 failing test): 在同一测试文件新增用例,把 HOME/.gemini/tmp/<project>/chats 目录设为不可读(chmod 000),mock 一次正常的 Gemini CLI 流(含 assistant 文本与结束事件),运行 node --test packages/api/test/gemini-agent-service.test.js --test-name-pattern "gemini unreadable chats"。期望:thinking 补全失败应被忽略,仍返回正常文本与 done;实际:这里的目录扫描抛出 EACCES 后会冒泡到 invoke 外层 catch,把一次成功回答转成 error 事件。
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Review triage for the reported P1s on
So these findings describe existing main-branch behavior brought in by the merge-from-main commit, not a regression introduced by the |
Summary
system_infohandler was missing thecontext_briefingbranch, causing raw JSON to render as a plain system bubble instead of a BriefingCardcontext_briefingconsumer touseSocket-background-system-info.ts, mirroring the existing foreground logic inuseAgentMessages.tsFixes #404
Test plan
pnpm exec vitest run src/hooks/__tests__/useSocket-background.test.ts -t "stores the briefing card message"— red before fix, green afterpnpm exec vitest run src/hooks/__tests__/useSocket-background.test.ts— 53/53 passCredits
🐾 Generated with Claude Code